require('@rushstack/eslint-patch/modern-module-resolution');

module.exports = {
  extends: [
    require.resolve('./presets/js'),
    require.resolve('./presets/ts'),
    require.resolve('./presets/react'),
    'plugin:prettier/recommended',
  ],
  root: true /* 禁止查找父文件夹 eslint 配置，加快 eslint 速度 */,
  ignorePatterns: [
    'dist/**/*.js',
    'dist/**/*.d.ts',
    'lib/**/*.js',
    'lib/**/*.d.ts',
    'es/**/*.js',
    'es/**/*.d.ts',
    '**/*.md',
  ],
  rules: {
    'no-redeclare': 'off',
    'no-unused-vars': 'off',
    'import/export': 'off',
    'arrow-body-style': 'off',
    'import/no-unresolved': 'off',
    'import/extensions': 'off',
    'import/no-extraneous-dependencies': 'off',
    'no-useless-constructor': 'off',
    'no-use-before-define': 'off',
    'import/no-unassigned-import': 'off',
    '@typescript-eslint/indent': 'off',
    '@typescript-eslint/explicit-function-return-type': 'off',
    '@typescript-eslint/explicit-module-boundary-types': 'off',
    '@typescript-eslint/ban-types': 'off',
    '@typescript-eslint/ban-ts-comment': 'off',
    '@typescript-eslint/no-namespace': 'off',
    'no-shadow': 'off',
    'no-new-func': 'off',
    'financial/no-division': 'off',
    '@typescript-eslint/no-empty-function': 'off',
    'no-throw-literal': 'off',
    'func-names': 'off',
    'prefer-rest-params': 'off',
    'no-unused-expressions': 'off',
    'no-return-assign': 'off',
    'array-callback-return': 'off',
    'no-cond-assign': 'off',
    'no-warning-comments': 'off',
    'no-guard-for-in': 'off',
  },
};
